package com.atguigu.gmall.publisher.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author hjy
 * @create 2023/3/22 16:00
 */

public interface SugarMapper {
    @Select("select sum(order_origin_total_amount) from dws_trade_sku_order_window where toYYYYMMDD(stt)=#{date}")
    BigDecimal getGMV(int date);

    //查出来多行多列的数据，决定用list<map>来存储
    @Select("select trademark_id,trademark_name,sum(order_origin_total_amount) total_amount  from dws_trade_sku_order_window where toYYYYMMDD(stt)=#{date} group by trademark_id,trademark_name order by total_amount limit #{limit};")
    List<Map> getTopN(int date,int limit);
}
